#! /bin/sh
# This program is part of SAM Linux Desktop
# Copyright 2004, Free Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.



if [ -x /usr/bin/gksu ]; then
export SU_PROG=gksu
PRESENT=1
fi

if [ -x /usr/bin/kdesu ]; then
export SU_PROG=kdesu
PRESENT=1
fi

if [ $PRESENT != 1 ]; then
zenity --warning --text="Please install gksu to run VIT"
exit
fi

export MAIN_DIALOG='
<window title="Video Installation Tool" icon-name="gnome-settings">

<vbox>
<hbox>
    <pixmap>
      <input file>/usr/share/mdk/backgrounds/vit.jpg</input>
    </pixmap>
</hbox>
  <notebook labels="%ATI_OLD%|%ATI_NEW%|%NVIDIA_OLDEST%|%NVIDIA_OLD%|%NVIDIA_NEW%">

    <vbox>
	<text wrap="true" width-chars="60" use-markup="true">
    		<label>"

driver: <b>%ATI_OLD%</b>

ATI proprietary X.org graphics driver, related libraries and configuration tools for ATI Desktop video cards 

- Radeon 9500 series cards up to Radeon X1900 series cards, 
- ATI Mobility products:
  * from Mobility Radeon 9500 up to Mobility Radeon X1800, 
- ATI Workstation FireGL products:
  * from FireGL X1-256p up to FireGL V7350
  * FireMV 2200, 
  * Mob. FireGL T2/V5000 
  * Radeon Xpress 200/200M/1250
"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"<b>Please make your selection.</b>"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    	<hbox homogeneous="true" spacing="10">
		<button>
			<label>"install driver: %ATI_OLD%"</label>
        		<action>$SU_PROG "xterm -hold -T installing... -e /usr/sbin/%ATI_OLD_SCRIPT%"</action>
       		</button>
		<button>
			<label>"remove driver: %ATI_OLD%"</label>
        		<action>$SU_PROG "xterm -hold -T removing... -e apt-get remove -y %ATI_OLD_PACKAGE%"</action>
       		</button>
    	</hbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    </vbox>

    <vbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"

driver: <b>%ATI_NEW%</b>

ATI proprietary X.org graphics driver, related libraries and configuration tools for ATI Desktop video cards 

This proprietary ATI driver supports these products:
- Radeon HD 2400/2600/2900 cards
"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"<b>Please make your selection.</b>"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    	<hbox homogeneous="true" spacing="10">
		<button>
			<label>"install driver: %ATI_NEW%"</label>
        		<action>$SU_PROG "xterm -hold -T installing... -e /usr/sbin/%ATI_NEW_SCRIPT%"</action>
       		</button>
		<button>
			<label>"remove driver: %ATI_NEW%"</label>
        		<action>$SU_PROG "xterm -hold -T removing... -e apt-get remove -y %ATI_NEW_PACKAGE%"</action>
       		</button>
    	</hbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    </vbox>

    <vbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"

driver: <b>%NVIDIA_OLDEST%</b>

NVIDIA proprietary X.org graphics driver, related libraries and configuration tools for old NVIDIA video cards.
 
Use this NVIDIA driver for these products:
- RIVA TNT cards
- RIVA/Aladdin TNT2 series cards
- Vanta series cards
- GeForce 256/DDR cards
- GeForce2 GTS/Pro/Ti/Ultra cards
- original Quadro cards
- Quadro2 Pro cards
 
For newer cards, please see the package %NVIDIA_OLD_PACKAGE% or %NVIDIA_NEW_PACKAGE% instead.
 
You should install this package if you want to enable the NVIDIA hardware OpenGL acceleration for those older cards.
"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"<b>Please make your selection.</b>"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    	<hbox homogeneous="true" spacing="10">
		<button>
			<label>"install driver: %NVIDIA_OLDEST%"</label>
        		<action>$SU_PROG "xterm -hold -T installing... -e /usr/sbin/%NVIDIA_OLDEST_SCRIPT%"</action>
       		</button>
		<button>
			<label>"remove driver: %NVIDIA_OLDEST%"</label>
        		<action>$SU_PROG "xterm -hold -T removing... -e apt-get remove -y %NVIDIA_OLDEST_PACKAGE%"</action>
       		</button>
    	</hbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    </vbox>

    <vbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"

driver: <b>%NVIDIA_OLD%</b>

NVIDIA proprietary X.org graphics driver, related libraries and configuration tools for most NVIDIA GeForce2/3/4 class video cards.
 
Use this NVIDIA driver for these products:
 - GeForce2 Go/MX series cards
 - GeForce3 series cards
 - GeForce4 series cards
 - Quadro NVS/DCC cards
 - Quadro NVS 280 SD cards
 - Quadro NVS 50 PCI cards
 - Quadro2 MXR/EX/Go cards
 - Quadro4 series cards
 
For older cards, please use the driver %NVIDIA_OLDEST_PACKAGE% instead. For newer cards, please use the driver %NVIDIA_NEW_PACKAGE%.
"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"<b>Please make your selection.</b>"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    	<hbox homogeneous="true" spacing="10">
		<button>
			<label>"install driver: %NVIDIA_OLD%"</label>
        		<action>$SU_PROG "xterm -hold -T installing... -e /usr/sbin/%NVIDIA_OLD_SCRIPT%"</action>
       		</button>
		<button>
			<label>"remove driver: %NVIDIA_OLD%"</label>
        		<action>$SU_PROG "xterm -hold -T removing... -e apt-get remove -y %NVIDIA_OLD_PACKAGE%"</action>
       		</button>
    	</hbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    </vbox>

    <vbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"

driver: <b>%NVIDIA_NEW%</b>

NVIDIA proprietary X.org graphics driver, related libraries and configuration tools for GeForce/Quadro based video cards.
 
PLEASE NOTE: This NVIDIA Linux graphics driver release supports GeForceFX and newer NVIDIA GPUs, GeForce4 and older GPUs are supported through the %NVIDIA_OLD_PACKAGE% and %NVIDIA_OLDEST_PACKAGE% NVIDIA legacy graphics drivers.
 
Use this NVIDIA driver for these products:
 - GeForce FX series cards
 - GeForce 6xxx series cards
 - GeForce 7xxx series cards
 - GeForce 8xxx series cards
 - Quadro FX series cards
 - Quadro NVS 280 PCI-E cards
 - Quadro NVS 110M/120M/285/440 cards
 - Quadro NVS 55/280 PCI cards
"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>"<b>Please make your selection.</b>"</label>
  	</text>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    	<hbox homogeneous="true" spacing="10">
		<button>
			<label>"install driver: %NVIDIA_NEW%"</label>
        		<action>$SU_PROG "xterm -hold -T installing... -e /usr/sbin/%NVIDIA_NEW_SCRIPT%"</action>
       		</button>
		<button>
			<label>"remove driver: %NVIDIA_NEW%"</label>
        		<action>$SU_PROG "xterm -hold -T removing... -e apt-get remove -y %NVIDIA_NEW_PACKAGE%"</action>
       		</button>
    	</hbox>
	<text wrap="true" width-chars="80" use-markup="true">
    		<label>" "</label>
  	</text>
    </vbox>

  </notebook>
    	<vbox homogeneous="true" spacing="10">
		<button>
			<label>"read me first: Nvidia Software License"</label>
        		<action>www-browser /usr/share/license/nvidia.html</action>
       		</button>
		<button>
			<label>"read me first: ATI Software License"</label>
        		<action>www-browser /usr/share/license/ati.html</action>
       		</button>
    	</vbox>
</vbox>

</window>
'

gtkdialog --program=MAIN_DIALOG
